package com.shbt.entity;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.annotation.Generated;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * TReleaseBuy entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "t_release_buy", catalog = "default_schema")
public class TReleaseBuy implements java.io.Serializable {

	// Fields

	private Integer id;
	private TPayBack TPayBack;
	private String releaseBuyCode;
	private String userCode;
	private Date createTime;
	private Date modifyTime;
	private Integer browseCount;
	private Integer commentCount;
	private String bookTitle;
	private String publish;
	private String author;
	private String backup;
	private Set<TReleaseBuyGoods> TReleaseBuyGoodses = new HashSet<TReleaseBuyGoods>(
			0);
	private Set<TReleaseBuyComment> TReleaseBuyComments = new HashSet<TReleaseBuyComment>(
			0);
	private Set<TReleaseBuyMoney> TReleaseBuyMoneies = new HashSet<TReleaseBuyMoney>(
			0);

	// Constructors

	/** default constructor */
	public TReleaseBuy() {
	}

	/** minimal constructor */
	public TReleaseBuy(Integer id, TPayBack TPayBack) {
		this.id = id;
		this.TPayBack = TPayBack;
	}

	/** full constructor */
	public TReleaseBuy(Integer id, TPayBack TPayBack, String releaseBuyCode,
			String userCode, Date createTime, Date modifyTime,
			Integer browseCount, Integer commentCount, String bookTitle,
			String publish, String author, String backup,
			Set<TReleaseBuyGoods> TReleaseBuyGoodses,
			Set<TReleaseBuyComment> TReleaseBuyComments,
			Set<TReleaseBuyMoney> TReleaseBuyMoneies) {
		this.id = id;
		this.TPayBack = TPayBack;
		this.releaseBuyCode = releaseBuyCode;
		this.userCode = userCode;
		this.createTime = createTime;
		this.modifyTime = modifyTime;
		this.browseCount = browseCount;
		this.commentCount = commentCount;
		this.bookTitle = bookTitle;
		this.publish = publish;
		this.author = author;
		this.backup = backup;
		this.TReleaseBuyGoodses = TReleaseBuyGoodses;
		this.TReleaseBuyComments = TReleaseBuyComments;
		this.TReleaseBuyMoneies = TReleaseBuyMoneies;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false)
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "t_pay_back_id", nullable = false)
	public TPayBack getTPayBack() {
		return this.TPayBack;
	}

	public void setTPayBack(TPayBack TPayBack) {
		this.TPayBack = TPayBack;
	}

	@Column(name = "release_buy_code", length = 20)
	public String getReleaseBuyCode() {
		return this.releaseBuyCode;
	}

	public void setReleaseBuyCode(String releaseBuyCode) {
		this.releaseBuyCode = releaseBuyCode;
	}

	@Column(name = "user_code", length = 20)
	public String getUserCode() {
		return this.userCode;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "create_time", length = 10)
	public Date getCreateTime() {
		return this.createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "modify_time", length = 10)
	public Date getModifyTime() {
		return this.modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}

	@Column(name = "browse_count")
	public Integer getBrowseCount() {
		return this.browseCount;
	}

	public void setBrowseCount(Integer browseCount) {
		this.browseCount = browseCount;
	}

	@Column(name = "comment_count")
	public Integer getCommentCount() {
		return this.commentCount;
	}

	public void setCommentCount(Integer commentCount) {
		this.commentCount = commentCount;
	}

	@Column(name = "book_title", length = 50)
	public String getBookTitle() {
		return this.bookTitle;
	}

	public void setBookTitle(String bookTitle) {
		this.bookTitle = bookTitle;
	}

	@Column(name = "publish", length = 50)
	public String getPublish() {
		return this.publish;
	}

	public void setPublish(String publish) {
		this.publish = publish;
	}

	@Column(name = "author", length = 20)
	public String getAuthor() {
		return this.author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	@Column(name = "backup", length = 65535)
	public String getBackup() {
		return this.backup;
	}

	public void setBackup(String backup) {
		this.backup = backup;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseBuy")
	public Set<TReleaseBuyGoods> getTReleaseBuyGoodses() {
		return this.TReleaseBuyGoodses;
	}

	public void setTReleaseBuyGoodses(Set<TReleaseBuyGoods> TReleaseBuyGoodses) {
		this.TReleaseBuyGoodses = TReleaseBuyGoodses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseBuy")
	public Set<TReleaseBuyComment> getTReleaseBuyComments() {
		return this.TReleaseBuyComments;
	}

	public void setTReleaseBuyComments(
			Set<TReleaseBuyComment> TReleaseBuyComments) {
		this.TReleaseBuyComments = TReleaseBuyComments;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "TReleaseBuy")
	public Set<TReleaseBuyMoney> getTReleaseBuyMoneies() {
		return this.TReleaseBuyMoneies;
	}

	public void setTReleaseBuyMoneies(Set<TReleaseBuyMoney> TReleaseBuyMoneies) {
		this.TReleaseBuyMoneies = TReleaseBuyMoneies;
	}

}